package com.reny.ll.git.base_logic.api

import com.reny.ll.git.base_logic.ext.authorization
import okhttp3.Interceptor
import okhttp3.Response


class BasicAuthInterceptor: Interceptor {

    override fun intercept(chain: Interceptor.Chain): Response {
        val reqBuilder = chain.request().newBuilder()
        //.addHeader("Content-Type","application/json")
        /*.addHeader("charset", "utf-8")*/
        authorization()?.let {
            reqBuilder.addHeader("Authorization", it)
        }
        return chain.proceed(reqBuilder.build())
    }

}